#if !defined(_Cryptoflex8Plugin_H)
#define _Cryptoflex8Plugin_H

#include <scott/Plugin.h>
#include <winscard.h>
#include <iostream>

CREATE_ALIAS( Cryptoflex8Plugin );

class DECLARATION_DLL Cryptoflex8Plugin :	public Plugin
{

	// Useful file descriptors references
	SEnumTypeDescriptorSp	AccessConditionTd;
	SEnumTypeDescriptorSp	AvailablePINsTd;
	SEnumTypeDescriptorSp	ChvDataTd;
	SEnumTypeDescriptorSp	ChvStatusTd;
	SEnumTypeDescriptorSp	CommandRestrictionsTd;
	SStructTypeDescriptorSp	DirInfoTd;
	SStructTypeDescriptorSp	DirSelectInfoTd;
	SStructTypeDescriptorSp	FileInfoTd;
	SEnumTypeDescriptorSp	FileStatusTd;
	SEnumTypeDescriptorSp	FileTypeTd;
	SVectorTypeDescriptorSp	VDirInfoTd;
	SVectorTypeDescriptorSp	VFileInfoTd;

public:

	Cryptoflex8Plugin();

	virtual void InitializePlugin(PluginSpMapSp plugins, INameResolutorSp nameResolutor);

	virtual void ExecuteCommand(CommandSp command);

	virtual SVectorSp ExecutePcscTransmit( string input );
	SVectorSp ExecuteGetResponse( string input );
	virtual string GetStatusDescription(BYTE sw1, BYTE sw2);
	virtual void SetCommonOutputs(BYTE sw1, BYTE sw2);

	// Plugin Command Handler Declarations
	virtual void Cryptoflex8_ChangeCHV();
	virtual void Cryptoflex8_CreateDF();
	virtual void Cryptoflex8_CreateEF();
	virtual void Cryptoflex8_CreateFile();
	virtual void Cryptoflex8_DeleteFile();
	virtual void Cryptoflex8_DirNext();
	virtual void Cryptoflex8_GetFilesInfo();
	virtual void Cryptoflex8_GetResponse();
	virtual void Cryptoflex8_Invalidate();
	virtual void Cryptoflex8_ReadBinary();
	virtual void Cryptoflex8_Rehabilitate();
	virtual void Cryptoflex8_RetrieveCLA();
	virtual void Cryptoflex8_Select();
	virtual void Cryptoflex8_SelectDF();
	virtual void Cryptoflex8_SelectEF();
	virtual void Cryptoflex8_UnblockCHV();
	virtual void Cryptoflex8_UpdateBinary();
	virtual void Cryptoflex8_VerifyCHV();
	virtual void Cryptoflex8_VerifyKey();

};

#endif  // _Cryptoflex8Plugin_H

